﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using ORS.BLL;

namespace ORS.Web
{
    public partial class WebForm4 : System.Web.UI.Page
    {
        DataTable dt;
        GetPaperInfomation ivk2_GetPaperInfo = new GetPaperInfomation();
        SetApprovalSate ivk_SetPaperApproval = new SetApprovalSate();
        public string  pointer_paper;
        public string  s_apr_state;
        int i, j,key;
                
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (System.Web.HttpContext.Current.Session["Admim_IDS"] == null)
                Response.Redirect("Login.aspx");
            else
            {
                Table_Edit.Visible = false;
                dt = ivk2_GetPaperInfo.GetPaperInfoList();
                gvpaper.DataSource = dt;
                gvpaper.DataBind();
             }
         }

        protected void btnapprove_Click(object sender, EventArgs e)
        {
           
           string[] Paper_IDs = this.Request["dgSelect"].Split(',');
            if (Paper_IDs != null)
            {
                
                Table_Edit.Visible = true;
                ivk2_GetPaperInfo.GetPaperInfo_by_PaperID(Paper_IDs[0]);
                tbx_title.Text = ivk2_GetPaperInfo.TITLE;
                tbx_cname.Text = ivk2_GetPaperInfo.AUTHOR;
                Paper_link.NavigateUrl =ivk2_GetPaperInfo.CONTENTLINK.Trim();
                Paper_link.Text = ivk2_GetPaperInfo.CONTENTLINK;
                if (ivk2_GetPaperInfo.REVIEWSTATE == 2)
                　　{ tbx_review.Text = "已通过初审"; }
                else
                　　{ tbx_review.Text = "未通过初审"; }
                tbx_reviewer.Text = ivk2_GetPaperInfo.REVIEWER;
              　tbx_interest.Text =ivk2_GetPaperInfo.interest_field;
                tbx_desc.Text = ivk2_GetPaperInfo.DESCRIPTION;
                lbl_ID.Text = Paper_IDs[0]; 
              }
            
        }

        protected void tbx_desc_TextChanged(object sender, EventArgs e)
        {

        }

        protected void btncomfirm_Click(object sender, EventArgs e)
        {
            pointer_paper = lbl_ID.Text;
            s_apr_state = rbtn_appove.SelectedItem.Value.Trim();
            ivk_SetPaperApproval.PaperApprove(pointer_paper, s_apr_state);
            dt = ivk2_GetPaperInfo.GetPaperInfoList();
            gvpaper.DataSource = dt;
            gvpaper.DataBind();

        }
    }
}